<template>
  <div class="danmu-manage">
    <!-- 页面标题和筛选区域 -->
    <div class="manage-header">
      <div class="header-title">
        <span>弹幕管理</span>
      </div>
      <div class="header-filter">
        <div class="filter-type">
          <div class="type-item active">全部弹幕</div>
          <div class="type-item">举报弹幕</div>
          <div class="type-item">已屏蔽</div>
        </div>
      </div>
    </div>

    <!-- 弹幕列表 -->
    <div class="danmu-list">
      <div class="list-header">
        <div class="header-cell creator-cell">发送者</div>
        <div class="header-cell publish-time-cell">发布时间</div>
        <div class="header-cell content-cell">弹幕内容</div>
        <div class="header-cell send-time-cell">发送时间</div>
        <div class="header-cell operations-cell">操作</div>
      </div>

      <!-- 列表内容为空时的提示 -->
      <div class="empty-content">
        <img
          src="/src/assets/icons/empty-message.svg"
          alt="暂无内容"
          class="empty-icon"
        />
        <p class="empty-text">暂无弹幕</p>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref, onMounted } from 'vue'

onMounted(() => {
  // 页面加载时的初始化逻辑
  console.log('弹幕管理页面加载完成')
})
</script>

<style scoped lang="scss">
.danmu-manage {
  width: 100%;

  // 页面标题和筛选区域
  .manage-header {
    margin-bottom: 20px;

    .header-title {
      margin-bottom: 16px;

      span {
        font-size: 18px;
        font-weight: 500;
        color: #18191c;
      }
    }

    .header-filter {
      .filter-type {
        display: flex;
        border-bottom: 1px solid #e3e5e7;

        .type-item {
          padding: 12px 16px;
          font-size: 14px;
          color: #61666d;
          cursor: pointer;
          position: relative;

          &:hover {
            color: #00aeec;
          }

          &.active {
            color: #00aeec;
            font-weight: 500;

            &::after {
              content: '';
              position: absolute;
              bottom: -1px;
              left: 0;
              width: 100%;
              height: 2px;
              background-color: #00aeec;
              border-radius: 1px;
            }
          }
        }
      }
    }
  }

  // 弹幕列表
  .danmu-list {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;

    .list-header {
      display: flex;
      height: 48px;
      background-color: #f6f7f8;
      border-bottom: 1px solid #e3e5e7;

      .header-cell {
        display: flex;
        align-items: center;
        padding: 0 16px;
        font-size: 14px;
        color: #61666d;
      }

      .creator-cell {
        width: 15%;
      }

      .publish-time-cell {
        width: 15%;
      }

      .content-cell {
        width: 40%;
      }

      .send-time-cell {
        width: 15%;
      }

      .operations-cell {
        width: 15%;
      }
    }

    // 空状态
    .empty-content {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 60px 0;

      .empty-icon {
        width: 160px;
        height: 160px;
        opacity: 0.6;
        margin-bottom: 16px;
      }

      .empty-text {
        font-size: 16px;
        color: #9499a0;
      }
    }
  }
}

// 响应式布局
@media screen and (max-width: 768px) {
  .danmu-manage {
    .manage-header {
      .header-filter {
        .filter-type {
          overflow-x: auto;
          white-space: nowrap;

          &::-webkit-scrollbar {
            display: none;
          }

          .type-item {
            padding: 12px 12px;
          }
        }
      }
    }

    .danmu-list {
      .list-header {
        .header-cell {
          padding: 0 8px;
          font-size: 12px;
        }

        .publish-time-cell,
        .send-time-cell {
          display: none;
        }

        .creator-cell {
          width: 20%;
        }

        .content-cell {
          width: 60%;
        }

        .operations-cell {
          width: 20%;
        }
      }
    }
  }
}
</style>
